﻿using System;
using System.Collections.Generic;

using Microsoft.Xna.Framework.Input;

using ZoeEngine.Framework;
using ZoeEngine.Services.Input;

namespace ZoeEngine.Components.Controllers
{
    public abstract class BaseKeyboardComponent : EntityComponent
    {
        private IInputService _inputService;

        public new virtual void Initialize()
        {
            base.Initialize();
        }
        public new virtual void Start()
        {
            base.Start();
            _inputService = Zoe.GetService<IInputService>();
            _inputService.KeyboardKeyDown += OnKeyboardKeyDown;
            _inputService.KeyboardKeyHeld += OnKeyboardKeyHeld;
            _inputService.KeyboardKeyUp += OnKeyboardKeyUp;
        }

        protected virtual void OnKeyboardKeyDown(object sender, KeyboardEventArgs e) { }
        protected virtual void OnKeyboardKeyHeld(object sender, KeyboardEventArgs e) { }
        protected virtual void OnKeyboardKeyUp(object sender, KeyboardEventArgs e) { }
    }
}
